
package com.yuan.servlet;

import com.yuan.hibernate.ConfigDAO;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class getconfigservlet extends BaseHttpServlet {
    private ConfigDAO mConfigDAO = null;
    private List<?> list = null;

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        super.doGet(request, response);
        mConfigDAO = new ConfigDAO();
        list = mConfigDAO.findAll();
        mResponse = com.yuan.util.JsonUtils.getFromList(list);
        closeAndClear();
    }

    protected synchronized void closeAndClear() {
        mConfigDAO = null;
        list = null;
        super.closeAndClear();
    }
}
